package com.hula.onion.book.server.controller;

import com.hula.onion.book.server.common.CommonResponse;
import com.hula.onion.book.server.service.RefundService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by work on 2018/3/26.
 */

@Api(value = "返现活动相关")
@RestController
@RequestMapping("/onion-book/api/v1/refund")
public class RefundController {


    @Autowired
    private RefundService refundService;

    @ApiOperation(value = "返现列表")
    @RequestMapping(value = "/list", method = RequestMethod.GET)
    public CommonResponse getRefundList(@RequestParam int page,
                                        @RequestParam int size) {
        return new CommonResponse(refundService.getRefundList(page, size));
    }


    @ApiOperation(value = "返现平台详情")
    @RequestMapping(value = "/detail", method = RequestMethod.GET)
    public CommonResponse getRefundDetail(@RequestParam int id) {
        return new CommonResponse(refundService.getRefundDetail(id));
    }

}
